#include <stdio.h>

int strStr(char* haystack, char* needle) {
    char* h = haystack, * n = needle;
    int i = 0;
    while (*h != '\0')
    {
        n = needle;
        h = haystack + i;
        while (*h != '\0' && *n != '\0' && *h == *n)
        {
            if (*(n + 1) == '\0')
                return i;
            h++, n++;
        }
        i++;
    }
    return -1;
}

int main()
{
    char* h = "leetteel";
    char* n = "ett";
    printf("%d\n", strStr(h, n));
    return 0;
}